//
//  UIScrollView+YFMJRefresh.m
//  CoollangTennisBall
//
//  Created by Coollang on 2017/9/9.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import "UIScrollView+YFMJRefresh.h"

@implementation UIScrollView (YFMJRefresh)

- (MJRefreshNormalHeader *)addLegendHeaderWithShowTime:(BOOL)showTime RefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock {
    MJRefreshNormalHeader *mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:refreshingBlock];
    if (showTime == NO) {  mj_header.lastUpdatedTimeLabel.hidden = YES; }
    self.mj_header = mj_header;
    mj_header.lastUpdatedTimeLabel.textColor = kTWhiteText;
    mj_header.stateLabel.textColor = kTWhiteText;
    [mj_header setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
    return mj_header;
}

- (MJRefreshAutoNormalFooter *)addAutoFooterWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock {
    MJRefreshAutoNormalFooter *mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:refreshingBlock];
    self.mj_footer = mj_footer;
    mj_footer.stateLabel.textColor = kTWhiteText;
    [mj_footer setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
    return mj_footer;
}

- (MJRefreshBackNormalFooter *)addNormalFooterWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock{
    MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:refreshingBlock];
    self.mj_footer = footer;
    footer.stateLabel.textColor = kTWhiteText;
    [footer setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
    return footer;
}

@end
